package 剑指offer;

/**
 * @author zhangjunfei
 * @date 2023/7/18 16:32
 */
public class O_10_01 {

    public int fib(int n) {
        if (n == 0) {
            return 0;
        }
        int a = 0, b = 1;
        for (int i = 0; i < n; i++) {
            int sum = (a + b) % 1000000007;
            a = b;
            b = sum;
        }
        return a;

    }
}
